/*
 *NOTE:Auto generated service implement
*/
package com.surfilter.modules.impPos.service.impl;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Service;

import com.surfilter.modules.impPos.model.HtImportPosModel;
import com.surfilter.modules.impPos.model.HtPosImgModel;
import com.surfilter.modules.impPos.dao.HtImportPosDao;
import com.surfilter.modules.impPos.dao.HtPosImgDao;
import com.surfilter.modules.impPos.service.ImpPosMgrService;
import com.surfilter.platform.base.model.ActionPermission;
import com.surfilter.platform.base.model.PageInfo;
import com.surfilter.platform.base.model.ParameterClassType;
import com.surfilter.platform.base.model.ParameterInfo;
import com.surfilter.platform.base.model.ParameterMapper;
import com.surfilter.platform.base.model.PermissionMethodType;
import com.surfilter.platform.base.service.ServiceBase;
import com.surfilter.platform.base.util.ParaUtil;

@Service(value = "impPosMgrService")
public class ImpPosMgrServiceImpl extends ServiceBase implements ImpPosMgrService {

	@Resource
	private HtImportPosDao htImportPosDao;
	@Resource
	private HtPosImgDao htPosImgDao;

	
	@ActionPermission(actionName = "addHtImportPos",remark = "添加重要区域")
	public java.lang.Integer addHtImportPos(HtImportPosModel htImportPosModel, HttpServletRequest request) {
		List<String> imgs = ParaUtil.getJSONList(request, "imgs", String.class);
		Integer id = htImportPosDao.addHtImportPos(htImportPosModel);
		for (String string : imgs) {
			HtPosImgModel model = new HtPosImgModel();
			model.setPosId(id);
			model.setImg(string);
			htPosImgDao.addHtPosImg(model);
		}
		return id;
	}
	
	@ActionPermission(actionName = "chgHtImportPos",remark = "")
	public void chgHtImportPos(HtImportPosModel htImportPosModel, HttpServletRequest request) {
		htImportPosDao.chgHtImportPos(htImportPosModel);
	}
	
	@ActionPermission(actionName = "delHtImportPos",remark = "")
	public void delHtImportPos(HtImportPosModel htImportPosModel, HttpServletRequest request) {
		htImportPosDao.delHtImportPos(htImportPosModel);
	}
	
	@ActionPermission(actionName = "getHtImportPoss",remark = "",permission=PermissionMethodType.MODULE)
	public List<HtImportPosModel> getHtImportPoss(HtImportPosModel htImportPosModel, HttpServletRequest request) {
		return htImportPosDao.getHtImportPoss(htImportPosModel, PageInfo.getPageInfo(request));
	}
	
	@ActionPermission(actionName = "delHtImportPoss",remark = "批量删除重点区域")
	public boolean delHtImportPoss(HttpServletRequest request){
		List<Integer> ids = ParaUtil.getJSONList(request, "ids", Integer.class);
		htImportPosDao.delHtImportPoss(ids);
		return true;
	}
	
	@ActionPermission(actionName = "getHtImportPossCount",remark = "")
	public int getHtImportPossCount(HtImportPosModel htImportPosModel) {
		return htImportPosDao.getHtImportPossCount(htImportPosModel);
	}
	
	
	@ActionPermission(actionName = "addHtPosImg",remark = "")
	public java.lang.Integer addHtPosImg(HtPosImgModel htPosImgModel, HttpServletRequest request) {
		return htPosImgDao.addHtPosImg(htPosImgModel);
	}
	
	@ActionPermission(actionName = "chgHtPosImg",remark = "")
	public void chgHtPosImg(HtPosImgModel htPosImgModel, HttpServletRequest request) {
		htPosImgDao.chgHtPosImg(htPosImgModel);
	}
	
	@ActionPermission(actionName = "delHtPosImg",remark = "")
	public void delHtPosImg(HtPosImgModel htPosImgModel, HttpServletRequest request) {
		htPosImgDao.delHtPosImg(htPosImgModel);
	}
	
	@ActionPermission(actionName = "getHtPosImgs",remark = "",permission=PermissionMethodType.MODULE)
	public List<HtPosImgModel> getHtPosImgs(HtPosImgModel htPosImgModel, HttpServletRequest request) {
		return htPosImgDao.getHtPosImgs(htPosImgModel, PageInfo.getPageInfo(request));
	}
	
	@ActionPermission(actionName = "delHtPosImgs",remark = "")
	@ParameterMapper({ @ParameterInfo(mapName = "ids", componentType = Integer.class, index = 0, mapType = ParameterClassType.ARRAY) })
	public boolean delHtPosImgs(List<java.lang.Integer> ids){
		htPosImgDao.delHtPosImgs(ids);
		return true;
	}
	
	@ActionPermission(actionName = "getHtPosImgsCount",remark = "")
	public int getHtPosImgsCount(HtPosImgModel htPosImgModel) {
		return htPosImgDao.getHtPosImgsCount(htPosImgModel);
	}
	}
